package com.mcptt.config.body.info.mcptt;


import com.cloudptt.api.product.func.call.CallAttr;

public class McpttInfoBody {

	public static final String CallType_Desc_Chat = "chat";
	public static final String CallType_Desc_Prearranged = "prearranged";
	public static final String CallType_Desc_Private = "private";
	public static final String CallType_Desc_OneToOnePull = "one-to-one video pull";
	public static final String CallType_Desc_OneToSvrPull = "one-from-server video pull";
	public static final String CallType_Desc_OneToOnePush = "one-to-one video push";
	public static final String CallType_Desc_OneToSvrPush = "one-to-server video push";
	public static final String CallType_Desc_Ambient_Listening = "ambient-listening";
	public static final String CallType_Desc_Ambient_Viewing = "ambient-viewing";

	public static final String MsgType_Desc_Oto_SDS = "one-to-one-sds";//一对一短数据
	public static final String MsgType_Desc_Group_SDS = "group-sds";//群组短数据
	public static final String MsgType_Desc_Oto_FD = "one-to-one-fd";//一对一文件发布

	public static final String MsgType_Desc_Group_FD = "group-fd";//群组文件发布
	public static final String MsgType_Desc_Msf_REQ = "msf-desc-req";//用户请求媒体存储资源的HTTP绝对地址
	public static final String MsgType_Desc_Msc_RES = "msc-dsc-res";//表示对媒体资源HTTP地址请求的响应
	public static final String MsgType_Desc_Notify = "notify";//Controlling Server向MCData客户端发送文件失效通知
	public static final String MsgType_Desc_Oto_SDS_Session = "one-to-one-sds-session";//客户端希望开始一对一SDS会话
	public static final String MsgType_Desc_Group_SDS_Session = "group-sds-session";//客户端希望开始群组SDS会话

	public static final String Boolean_Desc_True = "true";
	public static final String Boolean_Desc_False = "false";

	protected static int getCallTypeFromDesc(String desc)
	{
		if(CallType_Desc_Prearranged.equals(desc))
		{
			return CallAttr.CallType_Prearranged;
		}
		else if(CallType_Desc_Chat.equals(desc))
		{
			return CallAttr.CallType_Chat;
		}
		else if(CallType_Desc_OneToOnePull.equals(desc))
		{
			return CallAttr.CallType_Pull_One_To_One;
		}
		else if(CallType_Desc_OneToSvrPull.equals(desc))
		{
			return CallAttr.CallType_Pull_One_To_Svr;
		}
		else if(CallType_Desc_OneToOnePush.equals(desc))
		{
			return CallAttr.CallType_Push_One_To_One;
		}
		else if(CallType_Desc_OneToSvrPush.equals(desc))
		{
			return CallAttr.CallType_Push_One_To_Svr;
		}
		else if(CallType_Desc_Ambient_Listening.equals(desc))
		{
			return CallAttr.CallType_Ambient_Listening;
		}
		else if(CallType_Desc_Ambient_Viewing.equals(desc))
		{
			return CallAttr.CallType_Ambient_Viewing;
		}
		return CallAttr.CallType_Private;
	}

	protected static String getCallTypeDesc(int callType)
	{
		if(callType == CallAttr.CallType_Prearranged)
		{
			return CallType_Desc_Prearranged;
		}
		else if(callType == CallAttr.CallType_Chat)
		{
			return CallType_Desc_Chat;
		}
		else if(callType == CallAttr.CallType_Pull_One_To_One)
		{
			return CallType_Desc_OneToOnePull;
		}
		else if(callType == CallAttr.CallType_Pull_One_To_Svr)
		{
			return CallType_Desc_OneToSvrPull;
		}
		else if(callType == CallAttr.CallType_Push_One_To_One)
		{
			return CallType_Desc_OneToOnePush;
		}
		else if(callType == CallAttr.CallType_Push_One_To_Svr)
		{
			return CallType_Desc_OneToSvrPush;
		}
		else if(callType == CallAttr.CallType_Ambient_Listening)
		{
			return CallType_Desc_Ambient_Listening;
		}
		else if(callType == CallAttr.CallType_Ambient_Viewing)
		{
			return CallType_Desc_Ambient_Viewing;
		}
		else
		{
			return CallType_Desc_Private;
		}
	}

	
	protected static String getBooleanDesc(boolean val)
	{
		if(val)
		{
			return Boolean_Desc_True;
		}
		return Boolean_Desc_False;
	}
	
	protected static boolean getBooleanVal(String val)
	{
		if(Boolean_Desc_False.equals(val))
		{
			return true;
		}
		return false;
	}

}
